Conventionally, there are known specifications about general RTOS' (real-time operating systems) such as OSEK-OS and ITRON operating on an instruction execution unit such as a CPU. The specifications prescribe an interrupt level process and a task level process as categories of processes executed on the operating system.
Specifically, the RTOS specification prescribes an interface to accept execution requests for task level processes. When a program developer creates an application program that calls a specified program as a task level process, the program developer programs the application program so as to call the specified program using that interface.
The CPU may execute a process by accepting an interrupt signal from an interrupt controller. The RTOS specification prescribes such process as an interrupt level process. When the CPU executes a specified interrupt instruction, the instruction may be performed in a manner similarly to the case where the CPU receives an interrupt signal. In this case, a process may be executed based on execution of the specified interrupt instruction. The RTOS specification also prescribes this process as the interrupt level process.
Whether or not a process executed on the RTOS is the task level process can be determined based on how the process is executed. Specifically, a process is determined to be the task level process when that process is executed by using an interface (hereafter referred to as a task activation interface) for accepting a request for task level process execution. A process is not determined to be the task level process when that process is executed by not using the interface for accepting a request for task level process execution.
It is considered that the conventional RTOS accepts a request to execute the task level process via the above-mentioned task activation interface. In this case, the CPU compares priorities assigned to the task level process whose execution request is accepted, a currently executing process, and a task level process whose execution request was accepted in the past and whose execution is not complete yet at the present. The CPU executes the process having the highest priority. In this manner, the RTOS compares priorities and determines a process to be executed based on a comparison result. This is called RTOS task scheduling.
When the process currently executing on the RTOS terminates, the CPU performs the following during the RTOS task scheduling. The CPU compares priorities of task level processes whose execution requests were accepted in the past and whose execution is not complete yet at the present. The CPU executes the process having the highest priority.
Generally, the interrupt level process is configured to be executed at a higher priority than for the task level process. While the task level process is executed on the RTOS, the CPU may receive an interrupt signal from the interrupt controller. In such case, the CPU interrupts the currently executing task level process and executes the interrupt level process corresponding to the received interrupt signal.
A conventional interrupt controller has the multi-interrupt function. The multi-interrupt function chooses from a plurality of interrupt signals requested for output and outputs the most highly prioritized interrupt signal. Specifically, the interrupt controller having the multi-interrupt function outputs an interrupt signal to the CPU. When the CPU executes a process corresponding to that interrupt signal, the CPU may receive an output request from another interrupt signal. At this time, the controller compares the priority of the interrupt signal requested for output with that of the previously output interrupt signal. Only when the priority of the interrupt signal requested for output is higher than that of the previously output interrupt signal, the controller outputs the requested interrupt process to the CPU.
While the CPU executes the above-mentioned task scheduling under the conventional RTOS, much of the CPU processing time is consumed for the task scheduling process itself. As a result, this limits the CPU time actually available for the task level process and the interrupt level process.